#define  _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
#include<stdlib.h>

int cmp(const void* e1, const void* e2)
{
	return *(int*)e1 - *(int*)e2;
}
int main()
{
	int arr[1000] = { 0 }, i = 0, temp = 0, a[100] = { 0 }, j = 0, n = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &temp);
		if (arr[temp] == 0)
			a[j++] = temp;
		arr[temp] = 1;
	}	
	qsort(a, j, sizeof(int), cmp);
	printf("%d\n", j);
	for (i = 0; i < j; i++)
		printf("%d ", a[i]);
	return 0;
}